/* $RCSFile: InitPortal0.sql $
 Apache license v2 2011 by Christian Surieux
 Removing this comment is forbiddden
 $Source: ?/AddonNice/Setup/Scripts/InitPortal0.sql $
 $log$
 Revision 37 2010/08/09 12:26:56  christian.surieux
   Adding Log comment to sql files
*/
------------------
-- InitPortal0.sql
------------------


-----------------------------------------------------------
--Insert data into Portals
-----------------------------------------------------------
--	@PortalID	,	@PortalAlias	,	@PortalName	,	@PortalPath	
EXEC adn_Portals_IU 	0	,	N'AddonNice'	,	N'Addon Nice for Dynamics Crm'	,	N'/_AddonNice'
GO
--End insert portals

-----------------------------------------------------------
--Insert data into Portals Settings
-----------------------------------------------------------
--	@PortalID	,	@SettingName	,	@SettingValue
EXEC adn_PortalSettings_IU 	0	,	N'SITESETTINGS_PAGE_LAYOUT'	,	N'WebHeaderButton'
GO
EXEC adn_PortalSettings_IU 	0	,	N'SITESETTINGS_MODULELAYOUT' ,	N'Default'
GO
EXEC adn_PortalSettings_IU 	0	,	N'SITESETTINGS_ALT_MODULELAYOUT' ,	N'DefaultAlternate'
GO
EXEC adn_PortalSettings_IU 	0	,	N'SITESETTINGS_THEME_NET2'	,	N'Web20'
GO
EXEC adn_PortalSettings_IU 	0	,	N'SITESETTINGS_LANGLIST'	,	N'en;fr;'
GO


-----------------------------------------------------------
--Insert data into ModuleDefinitions: default pages/modules for initializing portal
-----------------------------------------------------------
IF(	IDENT_INCR( 'adn_ModuleDefinitions' ) IS NOT NULL OR IDENT_SEED('adn_ModuleDefinitions') IS NOT NULL ) SET IDENTITY_INSERT adn_ModuleDefinitions ON
-- Language switcher','LanguageSwitcher/LanguageSwitcher.ascx',0)
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('109','0','{25E3290E-3B9A-4302-9384-9CA01243C00F}')
-- Date Manager','DateManager/DateManager.ascx',0)
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('110','0','{D9E590FA-1D75-41a2-9480-56D4BF1ED8DD}')
-- Simple Image Manager','SimpleImage/SimpleImage.ascx',0)
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('111','0','{BCF1F338-4564-461C-9606-CB024D10294E}')
-- Announcements
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('113','0','{CE55A821-2449-4903-BA1A-EC16DB93F8DB}')
-- Documents
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('114','0','{F9645B82-CB45-4C4C-BB2D-72FA42FE2B75}')
-- HtmlModules
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('115','0','{0B113F51-FEA3-499A-98E7-7B83C192FDBB}')
-- MadiaPlayer Lib
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('116','0','{6FC1D24B-A2F4-409e-9630-0BF026955D30}')
-- iFrameModule
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('117','0','{2502DB18-B580-4F90-8CB4-C15E6E531005}')
-- Flash Module
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('118','0','{623EC4DD-BA40-421c-887D-D774ED8EBF02}')
-- Enhanced html
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('119','0','{875254B7-2471-491f-BAF8-4AFC261CC224}')
-- Enhanced links
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('120','0','{96BC3CE0-0409-4ab1-A0C2-67D6C4D68193}')
-- FileDirectory Tree
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('121','0','{2502DB18-B580-4F90-8CB4-C15E6E53100B}')
-- FAQs
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('122','0','{2502DB18-B580-4F90-8CB4-C15E6E531000}')
-- Contact info
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('123','0','{2502DB18-B580-4F90-8CB4-C15E6E5339EF}')
-- Lead Input
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('125','0','{79D0EBB1-8831-4f34-B568-66FBED4214A6}')
-- Lead Grid
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('126','0','{BD5908CF-ECB1-470d-AC6C-F77A7350C05B}')
-- Contact Input
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('127','0','{3A37C119-03A6-4ea1-8D46-44E0746B158A}')
-- Account Input
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('128','0','{53D45BCD-F66F-4029-A7C5-F915F7A6430C}')
-- Case Input
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('129','0','{C57020CE-9DA3-4e6e-908B-59072E652ADC}')
-- Pages Key Phrase
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('134','0','{ED58A5FB-D041-4a4b-826E-654250B61E7C}')
-- Shortcut
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('135','0','{23259716-3955-4f19-AB3F-503F99F63171}')
-- ShortcutAll
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('137','0','{B47BC165-91A2-4970-ADC5-5A3B727469E3}')
-- Crm attachments
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('143','0','{E1DFDBF6-4474-47ff-B0F2-3943EE90E10D}')
-- Crm ExLookup
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('144','0','{235572BA-C953-44a2-A4DB-0A5C120FE6F9}')
-- Account Tree
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('145','0','{F0DF5ACC-1341-4120-AF37-AEA6180509BB}')
-- Contact Tree
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('146','0','{751E8F56-1A74-431b-9940-5BEE8C2B5A43}')
-- Field Localizer
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('147','0','{B4734DDE-DDC8-41fe-B19F-34CEF1523C55}')
-- Import Pricing
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('148','0','{F466567D-159B-489b-A6DC-834DAFFC4A8E}')
-- Input Order
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('149','0','{0919E406-3478-40c8-B5DE-23DB9F8A998B}')
-- View Orders
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('150','0','{CB793372-5E72-4497-9AF7-DABF1ED77D40}')
-- Forum
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('151','0','{9E9B79AB-46B4-46bb-9636-60E217D1C58E}')
-- SilverModule
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('152','0','{0FA24F04-FB1A-4638-BB87-2BA48FFCF2C7}')
-- Rotating announcements
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('153','0','{9C20B03F-B385-48c1-B01E-6D3076FA2ECC}')
-- Rss Reader
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('154','0','{26C1FA26-0181-4b22-A2D1-6E206599C04D}')
-- Html Tabs
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('155','0','{5E303177-7FD3-4a17-A9CD-AA09A1592D6B}')
-- Crm Rating
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('156','0','{893D0AF4-A50B-4657-8F28-456790B475F3}')
-- Crm Rating Grid
INSERT INTO adn_ModuleDefinitions (ModuleDefID,PortalID,GeneralModDefID) VALUES('157','0','{CB230AD6-573E-487a-BC3E-C14B96EDBD7B}')
IF(	IDENT_INCR( 'adn_ModuleDefinitions' ) IS NOT NULL OR IDENT_SEED('adn_ModuleDefinitions') IS NOT NULL ) SET IDENTITY_INSERT adn_ModuleDefinitions OFF
GO

-----------------------------------------------------------
--Insert data into Pages AND modules
-----------------------------------------------------------

-- @TabID	,	@ParentTabID	,	@TabOrder	,	@PortalID	,	@TabName	,	@TabSkinID, @AuthorizedRoles	,	@TabLayout
-- Welcome for AddonNice
EXEC adn_Tabs_IU 	1001	,	1	,	1	,	0	,	N'Default Welcome'	, 'WelcomeSkin',	N'All Users'	,	NULL
GO
-- insert welcome page in public site
INSERT INTO adn_SiteMap (PortalID,ParentPageID,PageOrder,PageID) VALUES (0,null,1,1001)
GO

-- Users Page sub menu detail
-- Register, Page: 21 , only displayed when Forms authentication and located in login folder, register page ->  2+4+64
-- insert it in public site
INSERT INTO adn_SiteMap (PortalID,ParentPageID,PageOrder,PageID) VALUES (0,null,99998,21)
GO

-- Logon Page: 22 , only displayed when Forms authentication and located in login folder, login page ->  2+4+32
-- insert it in public site
INSERT INTO adn_SiteMap (PortalID,ParentPageID,PageOrder,PageID) VALUES (0,null,99999,22)
GO

-- Crm Pages
EXEC adn_Tabs_IU 	800	,	30	,	1	,	0	,	N'Demo Crm Page'	,'',	N'All Users;'	,	NULL
GO
EXEC adn_Modules_IU 	801,	800,	'{C57020CE-9DA3-4e6e-908B-59072E652ADC}', 1, N'ContentPane', N'Case Input', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
EXEC adn_Tabs_IU 	810	,	30	,	1	,	0	,	N'Lead Input'	,'',	N'All Users;'	,	NULL
GO
EXEC adn_Modules_IU 	811,	810,	'{79D0EBB1-8831-4f34-B568-66FBED4214A6}', 1, N'ContentPane', N'Lead Input', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
EXEC adn_Tabs_IU 	820	,	30	,	1	,	0	,	N'Contact Input'	,'',	N'All Users;'	,	NULL
GO
EXEC adn_Modules_IU 	821,	820,	'{3A37C119-03A6-4ea1-8D46-44E0746B158A}', 1, N'ContentPane', N'Contact Input', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
EXEC adn_Tabs_IU 	830	,	30	,	1	,	0	,	N'Lead Grid'	,'',	N'All Users;'	,	NULL
GO
EXEC adn_Modules_IU 	831,	830,	'{BD5908CF-ECB1-470d-AC6C-F77A7350C05B}', 1, N'ContentPane', N'Lead Grid', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO

-- Web Pages

EXEC adn_Tabs_IU 	900	,	40	,	1	,	0	,	N'Demo Web Page'	,'DefaultSkin',	N'All Users;'	,	NULL
GO
--	@ModuleID, @TabID, @GeneralModDefID, @ModuleOrder, @PaneName, @ModuleTitle, @AuthorizedEditRoles, @AuthorizedViewRoles, @AuthorizedAddRoles, @AuthorizedDeleteRoles, @AuthorizedPropertiesRoles, @CacheTime, @NewVersion, @LastModified, @LastEditor, @SupportCollapsable, @ShowEveryWhere, @AuthorizedMoveModuleRole,@AuthorizedDeleteModuleRoles	
EXEC adn_Modules_IU 	901,	900,	'{25E3290E-3B9A-4302-9384-9CA01243C00F}', 1, N'LeftPane', N'Select Language', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
EXEC adn_ModuleSettings_IU 	901	,	N'LANGUAGESWITCHER_TYPES'	,	0
GO

EXEC adn_Modules_IU 	902,	900,	'{72C6F60A-50C4-4F20-8F89-3E8A27820557}', 2, N'ContentPane', N'AddonNice Version', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
EXEC adn_Modules_IU 	903,	900,	'{CE55A821-2449-4903-BA1A-EC16DB93F8DB}', 3, N'LeftPane', N'Announcements!', N'All Users', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO
-- Insert a welcome message into announcement
DECLARE @dummyItem int
DECLARE @ndate datetime
SELECT @ndate=DATEADD(m,6, GETUTCDATE())
EXEC adn_AddAnnouncement 903,'System','Welcome','http://www.addonnice.com',@ndate,'Welcome inside Addon Nice for Microsoft Dynamics CRM',@dummyItem output
GO

EXEC adn_Modules_IU 	904,	900,	'{350CED6F-6739-43f3-8BF1-1D95187CA0BF}', 4, N'ContentPane', N'Start adding modules now!', N'Admins', N'All Users', N'Admins', N'Admins', N'Admins', 0, 0, NULL, NULL,0, 0, N'Admins', N'Admins'
GO


-- InitPortal0.sql
-- END
